var fooee_x,fooee_y;
function click_tr(id){
	var objc = document.getElementById("c"+id); //
	var objt = document.getElementById("t"+id);
	if (objc.checked==''){
		objc.checked = 'checked';
		objt.style.backgroundColor="#abc";
	}else{
		objc.checked = '';
		objt.style.backgroundColor="#fff";
	}
}

/*���ȫѡ�?*/
function click_allid(form,iValue){
	for (var i=0;i < form.elements.length;i++)
	{
		var e = form.elements[i];
		if (e.name=="id[]"){
			e.checked = iValue;
		}
	}
	/*
	//������ɫ
	var dvs=document.getElementById("click_idall").getElementsByTagName("tr");
	//alert(dvs.length);
	for (var i=0;i<dvs.length;i++){
		if (iValue==1){
			dvs[i].style.backgroundColor="#ffb";
		}else{
			dvs[i].style.backgroundColor="#fff";
		}
	}
	*/
}

function dialog(str,url,show,type){
	var title = '';
	var width = 300;
	var height = 150;
	var path = 'images/dialog/';
	if (type!=="")
	{
		var sfunc = '<input id="dialogOk" type="button" style="font-size:12px;width:71px;height:22px;line-height:24px;border-style:none;background:transparent url('+path+'button4.bmp);width: 71px;height: 22px;"  onmouseover=BtnOver(this,"'+path+'") onmouseout=BtnOut(this,"'+path+'") onclick=dialog("","../Member/","none") value="ȷ ��"  /> ';
	}else{
		var sfunc = '<input id="dialogOk" type="button" style="font-size:12px;width:71px;height:22px;line-height:24px;border-style:none;background:transparent url('+path+'button4.bmp);width: 71px;height: 22px;"  onmouseover=BtnOver(this,"'+path+'") onmouseout=BtnOut(this,"'+path+'") onclick=dialog("","","none") value="ȷ ��"  /> ';
	}
	var sclose = '<input type="image" title="�رյ�ǰ����" id="dialogBoxClose" src="' + path + 'dialogClose0.gif" border="0" width="16" height="16" onmouseover="this.src=\'' + path + 'dialogCloseF.gif\';" onmouseout="this.src=\'' + path + 'dialogClose0.gif\';" onclick=dialog("","","none") align="absmiddle" />';
	//alert(url);
	if (url!==""){window.location=url;}
	var sbody = '\
		<table id="dialogbodybox" style="border:1px solid #54B1F7;border-top:0;background:url('+path+'sbody_bg.png) repeat-x left bottom;" border="0" align="center" width="100%" height="100%">\
			<tr height="10"><td colspan="4"></td></tr>\
			<tr>\
				<td width="10"></td>\
				<td width=""80 align="center" id="ob_boxface"><img id="dialogboxface" src="'+path+'1.png" valign="absmiddle" style="behavior:url('+path+'png.htc);" /></td>\
				<td id="dialogmsg" style="font-size:12px;color:#000">' + str + '</td>\
				<td width="10"></td>\
			</tr>\
			<tr height="10"><td colspan="4" align="center"></td></tr>\
			<tr><td id="dialogFunc" colspan="4" align="center">' + sfunc + '</td></tr>\
			<tr height="10"><td colspan="4" align="center"></td></tr>\
		</table>\
	';
	var sBox = '\
		<div id="dialogBoxShadow" style="">\
		<table id="dialogBox" width="' + width + '" border="0" cellpadding="0" cellspacing="0" style="border:1px solid #1F3F94;z-index:10;">\
			<tr height="18" bgcolor="#1577D2" >\
				<td style="border:1px solid #91DEFA;border-bottom:0;">\
					<table onselectstart="return false;" style="-moz-user-select:none;background: url('+path+'win_top.png) repeat-x;" width="100%" border="0" cellpadding="0" cellspacing="0">\
						<tr>\
							<td width="6" ></td>\
							<td id="dialogBoxTitle" style="color:#fff;cursor:move;font-size:12px;font-weight:bold;">��ʾ��Ϣ</td>\
							<td id="dialogClose" width="27" align="right" valign="middle">\
								' + sclose + '\
							</td>\
							<td width="6"></td>\
						</tr>\
					</table>\
				</td>\
			</tr>\
			<tr id="dialogHeight" height="' + height + '">\
				<td id="dialogBody" style="background:#fff;color:#000;border:1px solid #91DEFA;border-top:0;">' + sbody + '</td>\
			</tr>\
		</table>\
		</div>\
		<iframe id="dialogBoxDivShim" scrolling="no" frameborder="0" style="position:absolute;top:0px; left:0px;display:none">\
	';
	document.getElementById("dialog").innerHTML=sBox;
	document.getElementById("dialogBoxShadow").style.visibility="visible";   
	document.getElementById("dialogBoxShadow").style.left=document.body.scrollLeft+document.body.offsetWidth/2-130;   
	document.getElementById("dialogBoxShadow").style.top=document.body.scrollTop+document.body.offsetHeight/2-76;   
	document.getElementById("dialog").style.display=show;
	//document.write ("<div id='dialog'></div>");
	//alert(str);
	
}
BtnOver = function(obj,path){obj.style.backgroundImage = "url("+path+"button3.bmp)";}
BtnOut = function(obj,path){obj.style.backgroundImage = "url("+path+"button4.bmp)"}
//dialog(text,"","block");
function close(){
	alert("asd");
	dialog("","","none");
	}

function MoveDialog(obj)
{
	if (event.button==1)
	{
		var x = obj.clientLeft;
		var y = obj.clientTop;
		obj.style.pixelLeft = x + (event.x-fooee_x);
		obj.style.pixelTop = y + (event.y-fooee_y);
	}
}

function createXMLHttp()
{ 
    var ret = null; 
    try { 
        ret = new ActiveXObject('Msxml2.XMLHTTP'); 
    } 
    catch (e) { 
        try { 
            ret = new ActiveXObject('Microsoft.XMLHTTP'); 
        } 
        catch (ee) { 
            ret = null; 
        } 
    } 
    if (!ret && typeof XMLHttpRequest != 'undefined'){
        ret = new XMLHttpRequest(); 
	}
    return ret; 
}

function Check(){
    if(document.addform.name.value ==  ""){
        alert("班级名不能为空!");
        document.addform.name.focus();
        return  false;
    }
    var username = document.addform.username.value;
    if (username.length == 0)
	{
		document.getElementById("user_info").innerHTML="* 不能为空！";
		return false;
	}
	else
	{
		if (username.length < 4 || username.length > 30)
		{
			document.getElementById("user_info").innerHTML="* 长度应为4~30个字符！";
			return false;
		}
	}
       var str=document.getElementById("user_info").innerHTML;
    if(str!="&nbsp;&nbsp;*" && str !="该账号可以使用！"){
        alert("账号不符合要求");
        return false;
    }
    if(document.addform.member_name.value ==  ""){
        alert("教师姓名不能为空!");
        document.addform.member_name.focus();
        return  false;
    }
    if(document.addform.departid.value !=  "" &&document.addform.departid.value !=  "-1"){
           var majorid = document.addform.majorid.value;
           if(majorid =="-1"){
                   alert("请选择专业!");
                   return false;
           }
    }
}
function CheckStd(){
    
    var username = document.addform.username.value;
    if (username.length == 0)
	{
		document.getElementById("user_info").innerHTML="* 不能为空！";
		return false;
	}
	else
	{
		if (username.length < 4 || username.length > 30)
		{
			document.getElementById("user_info").innerHTML="* 长度应为4~30个字符！";
			return false;
		}
	}
   var str=document.getElementById("user_info").innerHTML;
    if(str!="*只能输入4~30个字母或数字" && str !="该账号可以使用！"){
        alert("账号不符合要求");
        return false;
    }
    if(document.addform.member_name.value ==  ""){
        alert("学生姓名不能为空!");
        document.addform.member_name.focus();
        return  false;
    }
    if(document.addform.dueid.value ==  "-1"){
       alert("请选择届!");
       return false;
    }
    if(document.addform.departid.value ==  "-1"){
       alert("请选择系!");
       return false;
    }
    if(document.addform.departid.value !=  "" &&document.addform.departid.value !=  "-1"){
           var majorid = document.addform.majorid.value;
           if(majorid =="-1"){
                   alert("请选择专业!");
                   return false;
           }
    }
    if(document.addform.classid.value ==  "-1"){
        alert("请选择班级!");
        document.addform.classid.focus();
        return  false;
    }
}

function delid(){
        if(confirm("是否删除")){
               return true;
       }else{
               return false;
       }
}
   